/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package basedatos;

/**
 *
 * @author yojugracu
 */
public class BackUp {
       
    public final static void restaurar( String servidor, String puerto, String usuario, 
            String password, String bd, String path )
    {
        try {
            ProcessBuilder pbuilder;
            pbuilder = new ProcessBuilder( "pg_restore", "-i", "-h", servidor, "-p", 
                    puerto, "-U", usuario, "-d", bd, "-v", path );
            pbuilder.environment().put( "PGPASSWORD", password );
            pbuilder.redirectErrorStream(true);
            pbuilder.start();
        } catch (Exception e) { e.printStackTrace(); }
    }
}
